import { Directive, HostListener, Input } from '@angular/core';
declare const window: any;
@Directive({
  selector: '[appHref]'
})
export class HrefDirective {
  @Input() appHref: string;

  constructor() { }
  @HostListener('click', ['$event'])
  onClick(ev) {
    ev.preventDefault();
    if(this.appHref) {
      window.open(this.appHref);
    }
  }
}
